Using QCard DLL - Lesson 3 - Watson
Programming a Word Game - Terra
Adding an Icon to the Taskbar - Lewis
Beginning Programming IX - Moore
Rendering Solid Objects - Nally

Two years ago someone on the yahoo groups asked about placing an icon for their program on the taskbar. This was something that I knew I would need for a screen shot program that I was working on. I immediately jumped, head first, into the Microsoft Platform SDK, and soon thought I was going to drown. I worked on the Icon program until I started dreaming about API calls. I finally got it worked out, with code that would work on Win95, 98, ME, 2000, and XP. Or so I thought.
I submitted the code to the LB newsletter. Recently I have received several messages involving problems using the code with WinXP. I found that the major Problem with the code came from using type 'long' for passing windows handles to and from dll's. This was especially true when using an API that requested a handle from windows. I have since come to the conclusion that I would have to use 'Ulong' anywhere a handle was passed. Recently someone requested that I look at some code that was having problems when sent to the Notification Area of the Taskbar. This prompted me to do a rewrite of the original code, mainly because he was also trying to restore the main window from the icon.
This new version has been tested on Win98SE and WinXP Pro. It includes code to send the program to the notification area, and to restore the window and remove the icon. This can be done repeatedly. The program does not have to be restarted every time. If you read the commented header of the file, you will see how to send it to the Notification Area automatically after startup.
I have included many comments in the code, so I will not be going into great detail here. If you have any specific questions, please feel free to contact me. You can post questions on LB Yahoo groups, or on the conforums site. The conforums site has a private message system. Although I prefer that questions be posted publicly, so that many people can access the information.
A word of caution: The code should be used as supplied, in functions and sub-programs. Many times I have found that a problem was caused by moving some of the code from a sub or function to a branch label or gosub [branchLabel]. LB cannot see branch labels that are in the main program, while it is in a sub-program or function. It also cannot see branch labels inside a function or sub when in the main program, or in a sub or function different from the one the branch label is in. LB can call sub-programs and functions from both the main program, and from other sub's and functions. One last warning, do not change variable types, (long, Ulong, etc.). This has also caused many problems in the past.
I hope someone will be able to make use of this.
Ken Lewis, Sr.
Files included with this demo: